﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace EmbeddedSensorCloud.Core.Server
{
    public sealed class ClientOpenedEventArgs : EventArgs
    {
        public readonly int Port;
        public readonly IPAddress IP;

        public ClientOpenedEventArgs(EndPoint endPoint)
        {
            var ipEndPoint = (IPEndPoint)endPoint;

            this.Port = ipEndPoint.Port;
            this.IP = ipEndPoint.Address;
        }
    }

    public sealed class ClientClosedEventArgs : EventArgs
    {
        public readonly int Port;
        public readonly IPAddress IP;

        public ClientClosedEventArgs(EndPoint endPoint)
        {
            var ipEndPoint = (IPEndPoint)endPoint;

            this.Port = ipEndPoint.Port;
            this.IP = ipEndPoint.Address;
        }
    }

    public sealed class RequestParsedEventArgs : EventArgs
    {
        public readonly string Url;

        public RequestParsedEventArgs(string url)
        {
            this.Url = url;
        }
    }

    public sealed class RequestParsingFailedEventArgs : EventArgs
    {
        public readonly string FailureMessage;

        public RequestParsingFailedEventArgs(string failureMessage = null)
        {
            this.FailureMessage = failureMessage;
        }
    }

    public sealed class RespondedEventArgs : EventArgs
    {
    }


}